package hadoop.mapreduce.outputformat;

import org.apache.hadoop.mapreduce.RecordWriter;
import org.apache.hadoop.mapreduce.TaskAttemptContext;
import org.apache.hadoop.mapreduce.lib.output.FileOutputFormat;

import java.io.IOException;

/**
 * 自定义reducer阶段写出约束类的指定类
 */
public class LogOutputFormat extends FileOutputFormat {

    /**
     * 指定约束类
     * @param job
     * @return
     * @throws IOException
     * @throws InterruptedException
     */
    public RecordWriter getRecordWriter(TaskAttemptContext job) throws IOException, InterruptedException {
        return new LogRecordWriter(job);
    }
}
